import {reactive} from "vue";
import {NumberOfString} from "@/interface/FormInterface";


export interface StepOptions {
    active: number,
    data: NumberOfString[],
}

export function useSteps(data: NumberOfString[]) {
    const steps = reactive<StepOptions>({
        active: 1,
        data
    });
    const onNextStep = (isNextStep = true) => {
        if (isNextStep && steps.active < steps.data.length) {
            steps.active++
        } else if (!isNextStep && steps.active > 1) {
            steps.active--
        }
    }
    return {
        steps,
        onNextStep
    }
}
